package com.betterjr.modules.contract;

import static com.betterjr.common.web.ControllerExceptionHandler.exec;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.dubbo.config.annotation.Reference;
import com.betterjr.common.web.Servlets;

/** 
 * @ClassName: ContractBusinessStandardController 
 * @Description: 业务类型标准合同类型controller层
 * @author xuzx
 * @date 2017年10月20日 上午10:18:59 
 *  
 */

@Controller
@RequestMapping("/Platform/ContractBusinessStandard")
public class ContractBusinessStandardController {
    private static final Logger logger = LoggerFactory.getLogger(ContractBusinessStandardController.class);

    @Reference
    private IContractBusinessStandard contractBusinessStandard;

    /** 
     * @Title: queryAllContractStandardType 
     * @Description: 查询业务关联标准合同
     * @param request 页面
     * @param pageNum 页码        
     * @param pageSize 页长
     * @param flag     总计
     * @return TODO(说明)
     * @throws 
     * @author xuzx
     * @date 2017年10月20日 下午5:29:53 
     */
    @RequestMapping(value = "/queryAllContractStandardType", method = RequestMethod.POST)
    public @ResponseBody String queryAllContractStandardType(final HttpServletRequest request, final int pageNum,
            final int pageSize, final String flag) {
        logger.info("查询所有的业务类型标准合同类型关联");
        final Map<String, Object> anMap = Servlets.getParametersStartingWith(request, "");
        return exec(() -> contractBusinessStandard.webQueryBussinessStandard(anMap, pageNum, pageSize, flag),
                "查询所有的业务类型标准合同类型关联出错", logger);
    }
}